#!/usr/bin/env python
# Author: iris and jeff

PKG = 'sound_localization'

import roslib; roslib.load_manifest(PKG)
import rospy

from std_msgs.msg import String


class AudioLocTrainer():
    def __init__(self):
        rospy.Subscriber("audio_location_file", String, self.callback)
        self.pub = rospy.Publisher('audio_location_parameters', String)
        rospy.init_node('audio_loc_trainer', anonymous=True)
        while not rospy.is_shutdown():
            print "audio location parameters"
            self.pub.publish("audio location parameters" data )


    def callback(self,data):
        try:
            print "auio location trainer just received" + time_delay.data
        except rospy.ServiceException, e:
            print "Reply failed: %s"%e


if __name__ == '__main__':
    try:
        st = AudioLocTrainer()
        rospy.spin()
    except rospy.ROSInterruptException:
        pass
